package com.mysql.injector.enums;

public enum MySqlMethod {

  /**
   * 插入
   */
  INSERT_IGNORE("insertIgnore", "插入一条数据（重复存在忽略插入）",
    "<script>\nINSERT IGNORE INTO %s %s VALUES %s\n</script>"),
  INSERT_IGNORE_BATCH_SOME_COLUMN("insertIgnoreBatchSomeColumn", "批量新增数据（重复存在忽略插入）,自选字段",
    "<script>\nINSERT IGNORE INTO %s %s VALUES %s\n</script>"),
  REPLACE_INTO_BATCH_SOME_COLUMN("replaceIntoBatchSomeColumn", "批量替换新增数据,自选字段",
    "<script>\nREPLACE INTO %s %s VALUES %s\n</script>"),
  INSERT_ON_DUPLICATE_KEY_UPDATE("insertOnDuplicateKeyUpdate", "单条数据插入（重复存在更新）",
    "<script>\nINSERT INTO %s %s VALUES %s ON DUPLICATE KEY UPDATE %s\n</script>"),
  INSERT_ON_DUPLICATE_KEY_UPDATE_BATCH_SOME_COLUMN("insertOnDuplicateKeyUpdateBatchSomeColumn",
    "批量新增数据（重复存在更新）,自选字段",
    "<script>\nINSERT INTO %s %s VALUES %s ON DUPLICATE KEY UPDATE %s\n</script>");

  private final String method;
  private final String desc;
  private final String sql;

  MySqlMethod(String method, String desc, String sql) {
    this.method = method;
    this.desc = desc;
    this.sql = sql;
  }

  public String getMethod() {
    return method;
  }

  public String getDesc() {
    return desc;
  }

  public String getSql() {
    return sql;
  }

}
